import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] spells = new int[n];
        int[] potions = new int[m];
        long success = scanner.nextLong();

        for (int i = 0; i < n; i++) {
            spells[i] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            potions[i] = scanner.nextInt();
        }

        Solution solution = new Solution();
        int[] arr = solution.successfulPairs(spells,potions,success);
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] skill = new int[n];
        int[] mana = new int[m];
        for (int i = 0; i < n; i++) {
            skill[i] = scanner.nextInt();
        }

        for (int i = 0; i < m; i++) {
            mana[i] = scanner.nextInt();
        }

        Solution1 solution = new Solution1();
        System.out.println(solution.minTime(skill, mana));
    }
}

class Solution {

    public int[] successfulPairs(int[] spells, int[] potions, long success) {
        int n = spells.length;
        int m = potions.length;
        int[][] array = new int[n][2];
        for (int i = 0; i < n; i++) {
            array[i][0] = i;
            array[i][1] = spells[i];
        }
        int[] res = new int[n];
        Arrays.sort(spells);
        Arrays.sort(potions);
        int j = 0;
        for (int i = 0; i < n; i++) {
            if(j == 0){
                j = m -1;
            }
            for (; j >= 0; j--) {
                if((long) spells[i] * potions[j] < success){
                    res[i] = m - j;
                    break;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            for (int k = 0; k < n; k++) {//spell 1 3 5  5 1 3
                if(spells[k] == array[i][1]){
                    int t = res[i];
                    res[i] = res[k];
                    res[k] = t;
                    t = spells[i];
                    spells[i] = spells[k];
                    spells[k] = t;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            res[i]--;
        }
        return res;
    }
}

class Solution1 {
    public long minTime(int[] skill, int[] mana) {
        int n = skill.length;
        int m = mana.length;
        long[] lastFinish = new long[n];
        for (int i = 0; i < m; i++) {
            long sumTime = 0;
            for (int j = 0; j < n; j++) {
                sumTime = Math.max(sumTime, lastFinish[j]) + skill[j] * mana[i];
            }
            lastFinish[n - 1] = sumTime;
            for (int k = n - 2; k >= 0; k--) {
                lastFinish[k] = lastFinish[k + 1] - skill[k + 1] * mana[i];
            }
        }
        return lastFinish[n - 1];
    }
}